/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.futco.sysconthos.Modelo.Procesos.Daos;

import org.futco.sysconthos.Modelo.Admisiones.Daos.IDAO;
import org.futco.sysconthos.Modelo.Admisiones.Daos.Model;
import org.futco.sysconthos.Modelo.Proceso.Turno;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

/**
 *
 * @author Server
 */
public class TurnoDAO implements IDAO <Turno>{
 private Model model;
 private PreparedStatement psInsert;

  public TurnoDAO() throws SQLException {
        model = Model.getInstance();
    }

 public void insert(Turno t) throws SQLException {
          if (psInsert == null) {
            String sqlInsert = "INSERT INTO turno (codHorario, horaInicio, horaFin) VALUES (?,?,?)";
            psInsert = (PreparedStatement) model.getCon().prepareStatement(sqlInsert);

        psInsert.setString(1, t.getCodHorario());
      //  psInsert.setInt(2, t.getIndice());
        psInsert.setObject(2, t.getHoraInicio());
        psInsert.setObject(3, t.getHoraFin());
        psInsert.executeUpdate();
        }
    }

    public void delete(Turno t) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public List<Turno> getAll() throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public List<Turno> getAllBy(String t, String n) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Turno find(Integer id) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void update(String codigo, Turno t) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
